package com.zq.repository;

import com.zq.entity.Tag;
import com.zq.entity.Type;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Author:任人渐疏
 * @Date:Created in 11:34 上午 2020/6/27
 * Update:true
 */
public interface TypeRepository  extends JpaRepository<Type,Integer>, JpaSpecificationExecutor<Type> {
    @Query(nativeQuery = true,value = "select * from `type` where tname=?1")
    Type findByTagName(String tName);

    @Query(nativeQuery = true,value = "select * from `type`")
    List<Type> getAllType();
 }
